<script setup lang="ts">
import {computed} from 'vue'
const props = defineProps<{
  title?: string
  id?: number
}>()
const emit = defineEmits(['change-title'])
function handleChangeTitle () {
    emit('change-title', 'title from 1')
}
const localTitle = props.title + '---------'

const calcTitle = computed(()=>{
    if(props.title ) {
        return props.title + '||||-------'+ new Date().valueOf()
    }
})
</script>
<template>
    <div>

        <div @click="handleChangeTitle">title:{{ title }}</div>
        <div style="color: red">{{ localTitle }}</div>
        <div style="color: green">{{ calcTitle }}</div>
    </div>
</template>
